POV-Ray : Newsgroups : povray.advanced-users : Random points on surface of an object : Re: Random points on surface of an object Server Time
6 Oct 2024 14:03:37 EDT (-0400)
  Re: Random points on surface of an object  
From: Tim Attwood
Date: 20 Feb 2007 03:46:11
Message: <45dab553$1@news.povray.org>
> I have been playing with your macro and I have the following question, as 
> I am at a loss about how to solve it myself (see the image in p.b.i.).
>
> I scaled here the cones to a flat shape. What I would like is to always 
> have the eliptic bases oriented horizontally, whatever their location, not 
> like in the image, where part of them are oriented vertically. How could 
> that be achieved with your macro? I experimented a bit and read the docs, 
> but I am at a loss.

Trace and the RandOnSurface macro only return a point and a normal.

You could ignore the vertical portion of the normal and force some
object to be horizontal in respect to the horizon.
Point_At_Trans(vnormalize(<Norm.x,0,Norm.z>))
but you would need to decide what to do if the normal is vertical
or it might error out.

However, I think what you intend is to follow the shape of the object?
A normal isn't enough to generate info about how the surface
shape slopes nearby to some random point. You could trace nearby
points and rotate based on that perhaps.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.